//
//  NSString+Format.m
//  lvfj
//
//  Created by lvfeijun on 2021/8/3.
//  Copyright © 2021 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "NSString+Format.h"

@implementation NSString (Format)

+(NSString *)hq_timeFormtString:(CGFloat)padding type:(EnumTimeFormatType)type{
    if (type==EnumTimeFormatTypess) {
        return [NSString stringWithFormat:@"%02d",padding];
    }else if (type==EnumTimeFormatTypeHHmmss){
        int hours = ((int)padding)/3600;
        int minutes = ((int)padding)%3600/60;
        int seconds = ((int)padding)%3600%60;
        return [NSString stringWithFormat:@"%02d:%02d:%02d",hours,minutes,seconds];
    }
    else if (type==EnumTimeFormatTypeddHHmmss) {
        int days = ((int)padding)/(3600*24);
        int hours = ((int)padding)%(3600*24)/3600;
        int minutes = ((int)padding)%(3600*24)%3600/60;
        int seconds = ((int)padding)%(3600*24)%3600%60;
        return [NSString stringWithFormat:@"%d天 %02d:%02d:%02d",days,hours,minutes,seconds];
    }
    return @"0";
}

@end
